package com.zhiyou100.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhiyou100.IService.ICommentService;
import com.zhiyou100.mapper.TbCommentsMapper;
import com.zhiyou100.pojo.TbComments;
import com.zhiyou100.pojo.TbCommentsExample;
import com.zhiyou100.pojo.TbCommentsExample.Criteria;



@Service("commentService")
public  class CommentService implements ICommentService{

	//注入mapper对象
	@Resource
	private TbCommentsMapper commentsMapper;
	
	
	public List<TbComments> queryAll() {
		TbCommentsExample tbCommentsExample = new TbCommentsExample();
		Criteria criteria = tbCommentsExample.createCriteria();
		criteria.andCmStatusEqualTo(0);
		//查询
		return commentsMapper.selectByExample(tbCommentsExample);
	}
       

	public boolean deleteComment(Integer cmUsId) {
		
		return commentsMapper.deleteByPrimaryKey(cmUsId)>0?true:false;
	}
	


}